package com.pay.common.enums;

/**
 * 支付渠道枚举
 */
public enum PayChannelEnum {

    ALIPAY("alipay","支付宝"),
    WECHAT("wechat","微信"),
    ICBC("icbc","工行");


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    private String code;

    private String msg;


    PayChannelEnum (String code ,String msg){
        this.code = code;
        this.msg = msg;
    }


    /**
     * 根据code获取msg
     * @param code
     * @return
     */
    public String  getMsg(String code){

        for (PayChannelEnum payChannelEnum :PayChannelEnum.values()){

            if (code.equals(payChannelEnum.getCode())){

                return payChannelEnum.getMsg();
            }

        }

        return null;
    }


}
